﻿<phone:PhoneApplicationPage 
    x:Class="STEM123.ResultsPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False" xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit">

    <!--LayoutRoot contains the root grid where all other page content is placed-->
    <Grid x:Name="LayoutRoot">
        <Grid.Background>
            <ImageBrush ImageSource="/STEM123;component/STEMBackground.png" />
        </Grid.Background>
        <controls:Panorama Name="panResults" Title="Searching...">
            <!--Panorama item one-->
            <controls:PanoramaItem Header="By date">
                <ListBox Name="lstByDate" SelectionChanged="OnItemSelected">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <Grid Grid.Row="5" Grid.Column="2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="30"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="30"></RowDefinition>
                                        <RowDefinition Height="30"></RowDefinition>
                                        <RowDefinition Height="30"></RowDefinition>
                                        <RowDefinition Height="30"></RowDefinition>
                                        <RowDefinition Height="30"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <TextBlock Name="txtblockWithId" Text="{Binding PublishedOn, StringFormat='MMM/dd/yyyy'}" Grid.Row="0" Grid.ColumnSpan="2" FontSize="18" HorizontalAlignment="Left" VerticalAlignment="Top"></TextBlock>
                                    <Image Source="{Binding MediaType1}" Grid.Row="1" Grid.Column="0" Stretch="Fill" HorizontalAlignment="Left" VerticalAlignment="Top" ></Image>
                                    <Image Source="{Binding MediaType2}" Grid.Row="2" Grid.Column="0" Stretch="Fill" HorizontalAlignment="Left" VerticalAlignment="Top" ></Image>
                                    <Image Source="{Binding MediaType3}" Grid.Row="3" Grid.Column="0" Stretch="Fill" HorizontalAlignment="Left" VerticalAlignment="Top" ></Image>
                                    <TextBlock Text="{Binding Question1}" Grid.Row="1" Grid.Column="1" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                    <TextBlock Text="{Binding Question2}" Grid.Row="2" Grid.Column="1" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                    <TextBlock Text="{Binding Question3}" Grid.Row="3" Grid.Column="1" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                </Grid>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PanoramaItem>

            <!--Panorama item two-->
            <controls:PanoramaItem Header="By views">
                <ListBox Name="lstByViews" SelectionChanged="OnItemSelected">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <Grid Grid.Row="5" Grid.Column="2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="30"></ColumnDefinition>
                                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="30"></RowDefinition>
                                        <RowDefinition Height="30"></RowDefinition>
                                        <RowDefinition Height="30"></RowDefinition>
                                        <RowDefinition Height="30"></RowDefinition>
                                        <RowDefinition Height="30"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <TextBlock Name="txtblockWithId" Text="{Binding TimesViewed}" Grid.Row="0" Grid.Column="0" FontSize="18" HorizontalAlignment="Left" VerticalAlignment="Top"></TextBlock>
                                    <TextBlock Text="Views" Grid.Row="0" Grid.Column="1" FontSize="18" HorizontalAlignment="Left" VerticalAlignment="Top"></TextBlock>
                                    <Image Source="{Binding MediaType1}" Grid.Row="1" Grid.Column="0" Stretch="Fill" HorizontalAlignment="Left" VerticalAlignment="Top" ></Image>
                                    <Image Source="{Binding MediaType2}" Grid.Row="2" Grid.Column="0" Stretch="Fill" HorizontalAlignment="Left" VerticalAlignment="Top" ></Image>
                                    <Image Source="{Binding MediaType3}" Grid.Row="3" Grid.Column="0" Stretch="Fill" HorizontalAlignment="Left" VerticalAlignment="Top" ></Image>
                                    <TextBlock Text="{Binding Question1}" Grid.Row="1" Grid.Column="1" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                    <TextBlock Text="{Binding Question2}" Grid.Row="2" Grid.Column="1" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                    <TextBlock Text="{Binding Question3}" Grid.Row="3" Grid.Column="1" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Top" />
                                </Grid>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </controls:PanoramaItem>
        </controls:Panorama>
    </Grid>
</phone:PhoneApplicationPage>